<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<!-- onclick 点击事件 -->
	<!-- this 回调函数 默认全局对象 -->
	<div onclick="fn(this)">段落一</div>
	<div onclick="fn2(this)">段落二</div>
	<div onclick="fn3(this)">段落三</div>
	<script type="text/javascript">
		let div = document.querySelector('div')
		function fn(element){
			element.style.background = "red";
		}
		function fn2(element){
			element.style.background = "green";
		}
		function fn3(element){
			element.style.background = "orange";
		}
	</script>
		<button onclick="jia()">+</button>
		<input type="text" name="" value="7" >
		<button onclick="jian()">-</button>
	<script type="text/javascript">
		let add = document.querySelector('input')
		function jia(){
			add.value++

		}
		function jian(){
			if (add.value > 0){
				add.value--
			}
			
		}
	</script>
	

</body>
</html>